package com.corpdata.core.async.pool;

import org.slf4j.Logger;  
import org.slf4j.LoggerFactory;  
import org.springframework.scheduling.annotation.Async;  
import org.springframework.stereotype.Component;  

/**
 * 线程池测试
 * @author zealon
 *
 */
@Component
public class AsyncTask {  
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());    
        
    @Async("bizTaskAsyncPool")  //myTaskAsynPool即配置线程池的方法名，此处如果不写自定义线程池的方法名，会使用默认的线程池  
    public void doTask1(int i) throws InterruptedException{    
        logger.info("Task"+i+" started.");    
    }    
}    